﻿using System.ServiceModel;

namespace TfsGiggle.Core
{
    /// <summary>
    /// Do a search
    /// </summary>
    [ServiceContract(Namespace="http://tfsgiggle.codeplex.com")]
    public interface ISearch
    {
        /// <summary>
        /// Do a search
        /// </summary>
        /// <param name="userQuery"></param>
        /// <returns></returns>
        [OperationContract]
        QueryResultDTO Query(string userQuery);

        /// <summary>
        /// Get number of documents in the index
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        int GetNumberOfDocuments();

        /// <summary>
        /// Get this specific document
        /// </summary>
        /// <param name="documentId"></param>
        /// <returns></returns>
        [OperationContract]
        QueryResultDTO GetDocument(int documentId);

        /// <summary>
        /// Get the contents of this file
        /// </summary>
        /// <param name="teamProjectCollectionId"></param>
        /// <param name="filePath"></param>
        /// <returns></returns>
        [OperationContract]
        string GetFile(string teamProjectCollectionId, string filePath);
    }
}
